import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:top_foundation/utils/theme/button.dart';
import 'package:whale/helper/component/add_files.dart';
import 'package:whale/helper/component/photos.dart';
import 'package:whale/helper/component/upload_video.dart';
import 'package:whale/helper/utils/util.dart';
import 'package:whale/pages/home/main/widgets/widgets.dart';

import 'index.dart';
import 'widgets/widgets.dart';

class MedioPickerPage extends GetView<MedioPickerController> {
  const MedioPickerPage({Key? key}) : super(key: key);

  // 主视图
  Widget _buildView() {
    return ListView(
      padding: EdgeInsets.symmetric(horizontal: 12.r),
      children: [
        Container(
          padding: EdgeInsets.symmetric(vertical: 10.r),
          child: Text('选择图片，最多上传9张，长按拖动可删除'),
        ),
        AddPickersView(),
        AddVideoView(),
        AddFilesView(),
      ],
    );
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<MedioPickerController>(
      builder: (_) {
        return Scaffold(
          appBar: AppBar(title: const Text("图片，文件，视频选择器")),
          body: SafeArea(
            child: _buildView(),
          ),
        );
      },
    );
  }
}
